
package com.magicode.screen.bean;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 
 * @author wuxt
 *
 */
public class User extends Entity {

    private String userId;
	private String coinIos;
	private String coinAnd;
    private String userName;
    private String loginName;
	private String validateCode;
	private String password;//未加密的密码
    private String encPassword;//已加密的密码（第三方使用）
	private String mobile;
	private String email;
    private String currentCompanyName;//公司名
	private String jobName;//职称名
	private String userToken;//userToken
	private String userTokenRefreshTime;//userToken刷新时间

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date vipBeginTime;//购买开始时间
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date vipEndTime;//购买结束时间


	/**
	 * 根据用户判断是否VIP用户
	 * @return
	 */
	public boolean isVipUser(){
		boolean result = false;
		Date cDate = new Date();
		if(  this.getVipEndTime() != null){
			if(cDate.compareTo(this.getVipEndTime()) <= 0 ){
				result = true;
			}
		}
		return result;
	}

	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
		if(id == null){
			super.id = this.userId;
		}
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public String getValidateCode() {
		return validateCode;
	}
	public void setValidateCode(String validateCode) {
		this.validateCode = validateCode;
	}
	public String getEncPassword() {
		return encPassword;
	}
	public void setEncPassword(String encPassword) {
		this.encPassword = encPassword;
	}
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	public String getCurrentCompanyName() {
		return currentCompanyName;
	}

	public void setCurrentCompanyName(String currentCompanyName) {
		this.currentCompanyName = currentCompanyName;
	}

	public Date getVipBeginTime() {
		return vipBeginTime;
	}

	public void setVipBeginTime(Date vipBeginTime) {
		this.vipBeginTime = vipBeginTime;
	}

	public Date getVipEndTime() {
		return vipEndTime;
	}

	public void setVipEndTime(Date vipEndTime) {
		this.vipEndTime = vipEndTime;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserToken() {
		return userToken;
	}

	public void setUserToken(String userToken) {
		this.userToken = userToken;
	}

	public String getUserTokenRefreshTime() {
		return userTokenRefreshTime;
	}

	public void setUserTokenRefreshTime(String userTokenRefreshTime) {
		this.userTokenRefreshTime = userTokenRefreshTime;
	}

	public String getCoinIos() {
		return coinIos;
	}

	public void setCoinIos(String coinIos) {
		this.coinIos = coinIos;
	}

	public String getCoinAnd() {
		return coinAnd;
	}

	public void setCoinAnd(String coinAnd) {
		this.coinAnd = coinAnd;
	}
}
